# List
list = ["js", "python", "vue"]

# list - index
print(f"First element is {list[0]}")

# list - loop
for item in list:
    print(item)

# list - append 🏀🏀🏀🏀🏀🏀
list2 = ["vue", "react"]
list2.append("angular")
print(
    f"List 2 current elements", list2
)  # List 2 current elements ['vue', 'react', 'angular']


# list -extend 🏀🏀🏀🏀🏀🏀 : 分散添加, 被添加的value一定是一个可迭代对象 int / float 不可以
list2.extend("js")
print(
    f"List 2 current elements", list2
)  # List 2 current elements ['vue', 'react', 'angular', 'j', 's']
list2.extend(["java", "python"])
print(
    f"List 2 current elements", list2
)  # List 2 current elements ['vue', 'react', 'angular', 'j', 's', 'js', 'python']


# list -insert 🏀🏀🏀🏀🏀🏀: 必须指定一个下标添加
list2.insert(0, "php")
print(
    f"List 2 current elements", list2
)  # List 2 current elements ['php', 'vue', 'react', 'angular', 'j', 's', 'java', 'python']

# 获取长度
print(f"The length of list is: {len(list2)}")  # The length of list is: 8
